package com.leeon.exception;


class SimpleExcetion extends Exception{

}

public class InheritingExcetion {
    public void f() throws SimpleExcetion{
        System.out.println("Throw SimpleException");
        throw new SimpleExcetion();
    }

    public static void main(String[] args) {
        InheritingExcetion ie = new InheritingExcetion();
        try{
            ie.f();
        }catch (SimpleExcetion e){
            System.out.println("caught it ");
        }
    }
}
